<template>
    <div style="margin: 5px">
      <el-card style="height: 800px">
        <h2 slot="header">知识库数据管理</h2>
        <div>
          <el-upload
            class="upload-demo"
            action="https://jsonplaceholder.typicode.com/posts/"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
            multiple
            :limit="3"
            :on-exceed="handleExceed"
            :file-list="fileList">
            <el-button size="small" type="primary">点击上传</el-button>
          </el-upload>
        </div>
        <el-table
          :data="tableData"
          height="600"
          style="width: 100%">
          <el-table-column type="expand">
            <template slot-scope="props">
              <el-form label-position="left" inline class="demo-table-expand">
                <el-form-item label="报告内容">
                  <el-input v-model="props.row.content" type="textarea"></el-input>
                  <el-button size="mini" type="danger">
                    取消
                  </el-button>
                  <el-button size="mini" type="primary">
                    保存
                  </el-button>
                </el-form-item>
              </el-form>
              <!--              <div style="float: right;margin-top: 10px;">-->
              <!--                <el-button type="primary">保存</el-button>-->
              <!--              </div>-->
            </template>
          </el-table-column>
          <el-table-column
            type="index"
            width="50">
          </el-table-column>
          <el-table-column
            label="专家知识名称"
            prop="InfoName">
          </el-table-column>
          <el-table-column
            label="专家姓名"
            prop="name">
          </el-table-column>
          <el-table-column
            align="center"
            prop="type">
            <template  slot="header" slot-scope="scope">
              <el-select v-model="positionSelect" placeholder="报告类型" size="mini">
                <el-option v-for="item in positionSelectData" :key="item" size="mini"
                           :label="item.name" :value="item.value"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            label="时间"
            prop="time">
          </el-table-column>
          <el-table-column
            label="操作"
          > <template slot-scope="scope">
<!--            <el-button-->
<!--              size="mini" type="primary">下载</el-button>-->
            <el-button
              size="mini"
              type="danger"
            >删除</el-button>
          </template>
          </el-table-column>
        </el-table>
        <div style="margin-top: 10px;">
          <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage4"
                  :page-sizes="[10, 20, 50, 100]"
                  :page-size="20"
                  style="display: inline-block"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="400">
          </el-pagination>
        </div>
<!--        <div>-->
<!--          <label>知识库类型：</label>-->
<!--          <el-select v-model="positionSelect" placeholder="请选择知识库类型">-->
<!--            <el-option v-for="item in positionSelectData" :key="item" size="small"-->
<!--                       :label="item.name" :value="item.value"></el-option>-->
<!--          </el-select>-->
<!--        </div>-->
      </el-card>
    </div>
</template>

<script>
  export default {
    name: 'KnowledgeCard',
    data(){
      return{
        positionSelect:'',
        positionSelectData:[{name:'类型',value:1}],
        tableData: [{
          name: '常濮存',
          InfoName:'关于发电机的常见故障',
          type:'类型',
          time:'2020-11-02',
          content:'发电机的常见故障',
        }, {
          name: '崔光明',
          InfoName:'关于变桨系统的常见故障',
          type:'类型',
          time:'2020-11-03',
          content:'变桨系统的常见故障',
        }, {
          name: '张博赡',
          InfoName:'关于传动端轴承的常见故障',
          type:'类型',
          time:'2020-11-04',
          content:'传动端轴承的常见故障',
        }, {
          name: '孔正浩',
          InfoName:'关于发电机的常见故障',
          type:'类型',
          time:'2020-11-06',
          content:'电机的常见故障',
        },],
      }
    }
  }
</script>

<style scoped>

</style>
